package hmvictor.jpql.types;

import javax.swing.JCheckBox;
import javax.swing.JComponent;

/**
 *
 * @author Victor
 */
public class BooleanEditor implements Editor<Boolean>{
    private final JCheckBox checkbox=new JCheckBox();

    @Override
    public JComponent getComponent() {
        return checkbox;
    }

    @Override
    public Boolean getValue() {
        return checkbox.isSelected();
    }

    @Override
    public JComponent getComponent(Object initValue) {
        checkbox.setSelected((Boolean)initValue);
        return checkbox;
    }
    
}
